From: bgbsww <120601209+bgbsww@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:47:25 +0000 (-0500) Subject: [PATCH] Add support for OCCT 7.8.0 (#11909) X-Git-Tag: archive/raspbian/0.21.2+dfsg1-3+rpi1~1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=572074ba4715f9caf39c266b62d871060b4997eb;p=freecad.git [PATCH] Add support for OCCT 7.8.0 (#11909) Gbp-Pq: Name 0030-octt78.patch --- diff --git a/cMake/FindOCC.cmake b/cMake/FindOCC.cmake index 48e5c987..c72066f4 100644 --- a/cMake/FindOCC.cmake +++ b/cMake/FindOCC.cmake @@ -127,8 +127,6 @@ if(OCC_FOUND) TKG2d TKG3d TKMath - TKIGES - TKSTL TKShHealing TKXSBase TKBool @@ -139,10 +137,6 @@ if(OCC_FOUND) TKGeomBase TKOffset TKPrim - TKSTEPBase - TKSTEPAttr - TKSTEP209 - TKSTEP TKHLR TKFeat ) @@ -154,17 +148,20 @@ if(OCC_FOUND) TKLCAF TKVCAF TKCDF - TKXDESTEP - TKXDEIGES TKMeshVS TKService TKV3d ) - if(OCC_VERSION_STRING VERSION_LESS 6.7.3) - list(APPEND OCC_OCAF_LIBRARIES TKAdvTools) - elseif(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) + + if(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) list(APPEND OCC_OCAF_LIBRARIES TKRWMesh) - endif(OCC_VERSION_STRING VERSION_LESS 6.7.3) + endif(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) + if(OCC_VERSION_STRING VERSION_LESS 7.8.0) + list(APPEND OCC_LIBRARIES TKIGES TKSTL TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP) + list(APPEND OCC_OCAF_LIBRARIES TKXDESTEP TKXDEIGES) + else(OCC_VERSION_STRING VERSION_LESS 7.8.0) + list(APPEND OCC_LIBRARIES TKDESTEP TKDEIGES TKDEGLTF TKDESTL) + endif(OCC_VERSION_STRING VERSION_LESS 7.8.0) message(STATUS "-- Found OCE/OpenCASCADE version: ${OCC_VERSION_STRING}") message(STATUS "-- OCE/OpenCASCADE include directory: ${OCC_INCLUDE_DIR}") message(STATUS "-- OCE/OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}") diff --git a/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx b/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx index 3e083cd8..67e9f91c 100644 --- a/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx @@ -29,13 +29,26 @@ #include +#include + /* * This method needed for instance NCollection_DataMap with TopoDS_Shape as key */ +#if OCC_VERSION_HEX >= 0x070800 +struct SMESHDS_Hasher +{ + size_t operator()(const TopoDS_Shape& S) const noexcept { + return std::hash{}(S); + } + size_t operator()(const TopoDS_Shape& S1, const TopoDS_Shape& S2) const noexcept { + return S1.IsSame(S2); + } +}; +#else struct SMESHDS_Hasher { static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, - const TopoDS_Shape& S2) + const TopoDS_Shape& S2) { return S1.IsSame(S2); } @@ -45,6 +58,6 @@ struct SMESHDS_Hasher return ::HashCode( S, Upper); } }; - +#endif #endif diff --git a/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx b/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx index 3bc552eb..6155e205 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx @@ -57,9 +57,6 @@ #ifndef _MeshVS_EntityType_HeaderFile #include #endif -#ifndef _Standard_Address_HeaderFile -#include -#endif #ifndef _TColStd_HArray1OfInteger_HeaderFile #include #endif diff --git a/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx b/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx index 1094aed0..a8fe257e 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx @@ -37,4 +37,5 @@ #define SMESH_EXPORT #endif +#include #endif diff --git a/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx b/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx index ada6c8b9..33c7203c 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx @@ -28,10 +28,11 @@ #include "SMESH_SMESH.hxx" -#include #if OCC_VERSION_HEX >= 0x060703 #include #include +#else +#include #endif typedef const SMDS_MeshNode* SMDS_MeshNodePtr; diff --git a/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx b/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx index ac7aa480..7090537c 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx @@ -185,11 +185,18 @@ typedef std::vector< UVPtStruct > UVPtStructVec; // -------------------------------------------------------------------------------- // class SMESH_SequenceOfElemPtr +#include +#if OCC_VERSION_HEX >= 0x060703 +#include +#else #include +#endif class SMDS_MeshElement; typedef const SMDS_MeshElement* SMDS_MeshElementPtr; +#define DEFINE_SEQUENCE(_ClassName_, _BaseCollection_, TheItemType) \ +typedef NCollection_Sequence _ClassName_; DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr) diff --git a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp index ec3ea2e8..4b379129 100644 --- a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp +++ b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp @@ -33,10 +33,33 @@ #include "SMDS_MeshNode.hxx" #include "SMESH_File.hxx" +#include + namespace { struct Hasher { +#if OCC_VERSION_HEX >= 0x070800 + size_t operator()(const gp_Pnt& point) const noexcept + { + union + { + Standard_Real R[3]; + Standard_Integer I[6]; + } U; + + point.Coord( U.R[0], U.R[1], U.R[2] ); + return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); + } + + size_t operator()(const gp_Pnt& point1, const gp_Pnt& point2) const noexcept + { + static Standard_Real tab1[3], tab2[3]; + point1.Coord(tab1[0],tab1[1],tab1[2]); + point2.Coord(tab2[0],tab2[1],tab2[2]); + return (memcmp(tab1,tab2,sizeof(tab1)) == 0); + } +#else //======================================================================= //function : HashCode //purpose : @@ -51,9 +74,9 @@ namespace } U; point.Coord( U.R[0], U.R[1], U.R[2] ); - - return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper); + return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); } + //======================================================================= //function : IsEqual //purpose : @@ -66,7 +89,9 @@ namespace point2.Coord(tab2[0],tab2[1],tab2[2]); return (memcmp(tab1,tab2,sizeof(tab1)) == 0); } +#endif }; + typedef NCollection_DataMap TDataMapOfPntNodePtr; const int HEADER_SIZE = 84; diff --git a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp index 5d5c15c3..5ebf9dbf 100644 --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index 4e69796b..be04861c 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -28,7 +28,6 @@ # include # include -# include #endif #include diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index 2397b62c..23153d31 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -148,7 +148,11 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, std::vector localValue; if (aShapeTool->GetShape(label,aShape)) { +#if OCC_VERSION_HEX >= 0x070800 + hash = std::hash {}(aShape); +#else hash = aShape.HashCode(HashUpper); +#endif } Handle(TDataStd_Name) name; @@ -217,9 +221,13 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, if (isRef || myRefShapes.find(hash) == myRefShapes.end()) { TopoDS_Shape aShape; - if (isRef && aShapeTool->GetShape(label, aShape)) - myRefShapes.insert(aShape.HashCode(HashUpper)); - + if (isRef && aShapeTool->GetShape(label, aShape)) { +#if OCC_VERSION_HEX >= 0x070800 + myRefShapes.insert(std::hash {}(aShape)); +#else + myRefShapes.insert(aShape.HashCode(HashUpper)); +#endif + } if (aShapeTool->IsSimpleShape(label) && (isRef || aShapeTool->IsFree(label))) { if (!asm_name.empty()) part_name = asm_name; @@ -532,7 +540,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna part->Label.setValue(default_name); part->Shape.setValue(shape); std::map::const_iterator jt; +#if OCC_VERSION_HEX >= 0x070800 + jt = myColorMap.find(std::hash {}(shape)); +#else jt = myColorMap.find(shape.HashCode(INT_MAX)); +#endif App::Color partColor(0.8f,0.8f,0.8f); #if 0//TODO @@ -553,7 +565,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna // set label name if defined if (setname && !myNameMap.empty()) { std::map::const_iterator jt; +#if OCC_VERSION_HEX >= 0x070800 + jt = myNameMap.find(std::hash {}(shape)); +#else jt = myNameMap.find(shape.HashCode(INT_MAX)); +#endif if (jt != myNameMap.end()) { part->Label.setValue(jt->second); } @@ -573,7 +589,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna faceColors.resize(faces.Extent(), partColor); xp.Init(shape,TopAbs_FACE); while (xp.More()) { +#if OCC_VERSION_HEX >= 0x070800 + jt = myColorMap.find(std::hash {}(xp.Current())); +#else jt = myColorMap.find(xp.Current().HashCode(INT_MAX)); +#endif if (jt != myColorMap.end()) { int index = faces.FindIndex(xp.Current()); faceColors[index-1] = convertColor(jt->second); @@ -607,24 +627,59 @@ void ImportXCAF::loadShapes(const TDF_Label& label) int ctSolids = 0, ctShells = 0, ctComps = 0; // add the shapes TopExp_Explorer xp; - for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) + for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { +#if OCC_VERSION_HEX >= 0x070800 + this->mySolids[std::hash {}(xp.Current())] = (xp.Current()); +#else this->mySolids[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) +#endif + } + for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) { +#if OCC_VERSION_HEX >= 0x070800 + this->myShells[std::hash {}(xp.Current())] = (xp.Current()); +#else this->myShells[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif + } // if no solids and no shells were found then go for compounds if (ctSolids == 0 && ctShells == 0) { - for (xp.Init(aShape, TopAbs_COMPOUND); xp.More(); xp.Next(), ctComps++) + for (xp.Init(aShape, TopAbs_COMPOUND); xp.More(); xp.Next(), ctComps++) { +#if OCC_VERSION_HEX >= 0x070800 + this->myCompds[std::hash {}(xp.Current())] = (xp.Current()); +#else this->myCompds[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif + } } if (ctComps == 0) { - for (xp.Init(aShape, TopAbs_FACE, TopAbs_SHELL); xp.More(); xp.Next()) + for (xp.Init(aShape, TopAbs_FACE, TopAbs_SHELL); xp.More(); xp.Next()) { +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash {}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next()) +#endif + } + for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next()) { +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash {}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next()) +#endif + } + for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next()) { +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash {}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next()) +#endif + } + for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next()) { +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash {}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif + } } } @@ -634,7 +689,11 @@ void ImportXCAF::loadShapes(const TDF_Label& label) hColors->GetColor(label, XCAFDoc_ColorSurf, col) || hColors->GetColor(label, XCAFDoc_ColorCurv, col)) { // add defined color +#if OCC_VERSION_HEX >= 0x070800 + myColorMap[std::hash {}(aShape)] = col; +#else myColorMap[aShape.HashCode(INT_MAX)] = col; +#endif } else { // http://www.opencascade.org/org/forum/thread_17107/ @@ -644,7 +703,11 @@ void ImportXCAF::loadShapes(const TDF_Label& label) hColors->GetColor(it.Value(), XCAFDoc_ColorSurf, col) || hColors->GetColor(it.Value(), XCAFDoc_ColorCurv, col)) { // add defined color +#if OCC_VERSION_HEX >= 0x070800 + myColorMap[std::hash {}(it.Value())] = col; +#else myColorMap[it.Value().HashCode(INT_MAX)] = col; +#endif } } } @@ -656,8 +719,13 @@ void ImportXCAF::loadShapes(const TDF_Label& label) char* str = new char[extstr.LengthOfCString()+1]; extstr.ToUTF8CString(str); std::string labelName(str); - if (!labelName.empty()) + if (!labelName.empty()) { +#if OCC_VERSION_HEX >= 0x070800 + myNameMap[std::hash {}(aShape)] = labelName; +#else myNameMap[aShape.HashCode(INT_MAX)] = labelName; +#endif + } delete [] str; } diff --git a/src/Mod/Import/App/ImportOCAF2.h b/src/Mod/Import/App/ImportOCAF2.h index e19b9219..ff231d58 100644 --- a/src/Mod/Import/App/ImportOCAF2.h +++ b/src/Mod/Import/App/ImportOCAF2.h @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -42,6 +41,7 @@ #include "ImportOCAF.h" #include "ExportOCAF.h" +#include class TDF_Label; class TopLoc_Location; @@ -58,13 +58,21 @@ namespace Import { struct ShapeHasher { std::size_t operator()(const TopoDS_Shape &s) const { - return s.HashCode(INT_MAX); +#if OCC_VERSION_HEX >= 0x070800 + return std::hash {}(s); +#else + return shape.HashCode(INT_MAX); +#endif } }; struct LabelHasher { std::size_t operator()(const TDF_Label &l) const { - return TDF_LabelMapHasher::HashCode(l,INT_MAX); +#if OCC_VERSION_HEX >= 0x070800 + return std::hash {}(l); +#else + return TDF_LabelMapHasher::HashCode(l, INT_MAX); +#endif } }; diff --git a/src/Mod/MeshPart/App/CurveProjector.h b/src/Mod/MeshPart/App/CurveProjector.h index 4fb0d5ff..49287574 100644 --- a/src/Mod/MeshPart/App/CurveProjector.h +++ b/src/Mod/MeshPart/App/CurveProjector.h @@ -32,6 +32,7 @@ #include #include +#include namespace MeshCore { @@ -63,8 +64,13 @@ public: template struct TopoDSLess { bool operator()(const T& x, const T& y) const { - return x.HashCode(INT_MAX-1) < y.HashCode(INT_MAX-1); - } +#if OCC_VERSION_HEX >= 0x070800 + std::hash hasher; + return hasher(x) < hasher(y); +#else + return x.HashCode(INT_MAX - 1) < y.HashCode(INT_MAX - 1); +#endif + } }; using result_type = std::map,TopoDSLess >; diff --git a/src/Mod/Part/App/ImportStep.cpp b/src/Mod/Part/App/ImportStep.cpp index 6c41ac53..1d02eb2d 100644 --- a/src/Mod/Part/App/ImportStep.cpp +++ b/src/Mod/Part/App/ImportStep.cpp @@ -137,7 +137,12 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) // This is a trick to access the GUI via Python and set the color property // of the associated view provider. If no GUI is up an exception is thrown // and cleared immediately +#if OCC_VERSION_HEX >= 0x070800 + std::hash hasher; + std::map::iterator it = hash_col.find(hasher(aSolid)); +#else std::map::iterator it = hash_col.find(aSolid.HashCode(INT_MAX)); +#endif if (it != hash_col.end()) { try { Py::Object obj(pcFeature->getPyObject(), true); diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index c73a70c1..0bf5f814 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1304,7 +1304,11 @@ PyObject* TopoShapePy::ancestorsOfType(PyObject *args) TopTools_ListIteratorOfListOfShape it(ancestors); for (; it.More(); it.Next()) { // make sure to avoid duplicates +#if OCC_VERSION_HEX >= 0x070800 + const size_t code = std::hash{}(static_cast(it.Value())); +#else Standard_Integer code = it.Value().HashCode(INT_MAX); +#endif if (hashes.find(code) == hashes.end()) { list.append(shape2pyshape(it.Value())); hashes.insert(code); @@ -1919,7 +1923,11 @@ PyObject* TopoShapePy::hashCode(PyObject *args) if (!PyArg_ParseTuple(args, "|i",&upper)) return nullptr; +#if OCC_VERSION_HEX >= 0x070800 + int hc = std::hash{}(getTopoShapePtr()->getShape()); +#else int hc = getTopoShapePtr()->getShape().HashCode(upper); +#endif return Py_BuildValue("i", hc); } diff --git a/src/Mod/Part/Gui/AppPartGui.cpp b/src/Mod/Part/Gui/AppPartGui.cpp index 2ca6e878..54553611 100644 --- a/src/Mod/Part/Gui/AppPartGui.cpp +++ b/src/Mod/Part/Gui/AppPartGui.cpp @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include #endif #include diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index b057ef4a..c8d06c39 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -26,7 +26,6 @@ # include # include # include -# include # include # include # include diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index e46d034e..aaa04fe2 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include #endif diff --git a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp index 1f42410a..7e35addb 100644 --- a/src/Mod/Part/Gui/CrossSections.cpp +++ b/src/Mod/Part/Gui/CrossSections.cpp @@ -28,7 +28,6 @@ # include # include -# include # include # include diff --git a/src/Mod/Part/Gui/ViewProvider2DObject.cpp b/src/Mod/Part/Gui/ViewProvider2DObject.cpp index 880586d3..61ff9057 100644 --- a/src/Mod/Part/Gui/ViewProvider2DObject.cpp +++ b/src/Mod/Part/Gui/ViewProvider2DObject.cpp @@ -25,7 +25,6 @@ #ifndef _PreComp_ # include -# include # include # include diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 554f7a40..4ad97b08 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -987,7 +987,11 @@ void ViewProviderPartExt::updateVisual() TopExp_Explorer xp; for (xp.Init(faceMap(i),TopAbs_EDGE);xp.More();xp.Next()) +#if OCC_VERSION_HEX >= 0x070800 + faceEdges.insert(std::hash{}(xp.Current())); +#else faceEdges.insert(xp.Current().HashCode(INT_MAX)); +#endif numFaces++; } @@ -1015,7 +1019,11 @@ void ViewProviderPartExt::updateVisual() // So, we have to store the hashes of the edges associated to a face. // If the hash of a given edge is not in this list we know it's really // a free edge. +#if OCC_VERSION_HEX >= 0x070800 + int hash = std::hash{}(aEdge); +#else int hash = aEdge.HashCode(INT_MAX); +#endif if (faceEdges.find(hash) == faceEdges.end()) { Handle(Poly_Polygon3D) aPoly = Part::Tools::polygonOfEdge(aEdge, aLoc); if (!aPoly.IsNull()) { @@ -1214,7 +1222,11 @@ void ViewProviderPartExt::updateVisual() TopLoc_Location aLoc; // handling of the free edge that are not associated to a face +#if OCC_VERSION_HEX >= 0x070800 + int hash = std::hash{}(aEdge); +#else int hash = aEdge.HashCode(INT_MAX); +#endif if (faceEdges.find(hash) == faceEdges.end()) { Handle(Poly_Polygon3D) aPoly = Part::Tools::polygonOfEdge(aEdge, aLoc); if (!aPoly.IsNull()) { diff --git a/src/Mod/Part/Gui/ViewProviderExt.h b/src/Mod/Part/Gui/ViewProviderExt.h index 01b75aaa..94b2866e 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.h +++ b/src/Mod/Part/Gui/ViewProviderExt.h @@ -24,7 +24,6 @@ #define PARTGUI_VIEWPROVIDERPARTEXT_H #include -#include #include #include diff --git a/src/Mod/Part/Gui/ViewProviderMirror.cpp b/src/Mod/Part/Gui/ViewProviderMirror.cpp index f9210f90..1f9132cc 100644 --- a/src/Mod/Part/Gui/ViewProviderMirror.cpp +++ b/src/Mod/Part/Gui/ViewProviderMirror.cpp @@ -27,7 +27,6 @@ # include # include -# include # include # include diff --git a/src/Mod/Part/Gui/ViewProviderPython.cpp b/src/Mod/Part/Gui/ViewProviderPython.cpp index e7fa75fe..1b6a1ff8 100644 --- a/src/Mod/Part/Gui/ViewProviderPython.cpp +++ b/src/Mod/Part/Gui/ViewProviderPython.cpp @@ -22,7 +22,6 @@ #include "PreCompiled.h" -#include #ifndef _PreComp_ # include #endif diff --git a/src/Mod/Part/Gui/ViewProviderReference.h b/src/Mod/Part/Gui/ViewProviderReference.h index b7a0219b..af40af2f 100644 --- a/src/Mod/Part/Gui/ViewProviderReference.h +++ b/src/Mod/Part/Gui/ViewProviderReference.h @@ -24,7 +24,6 @@ #ifndef PARTGUI_ViewProviderPartReference_H #define PARTGUI_ViewProviderPartReference_H -#include #include #include #include diff --git a/src/Mod/Path/App/Voronoi.cpp b/src/Mod/Path/App/Voronoi.cpp index 27a509c2..443b7475 100644 --- a/src/Mod/Path/App/Voronoi.cpp +++ b/src/Mod/Path/App/Voronoi.cpp @@ -22,7 +22,8 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +#define _USE_MATH_DEFINES +# include #endif #include diff --git a/src/Mod/Path/Gui/PreCompiled.h b/src/Mod/Path/Gui/PreCompiled.h index f12ef8f9..ed8cef50 100644 --- a/src/Mod/Path/Gui/PreCompiled.h +++ b/src/Mod/Path/Gui/PreCompiled.h @@ -38,8 +38,6 @@ # define PathGuiExport #endif -#include - #ifdef _MSC_VER # pragma warning( disable : 4273 ) #endif diff --git a/src/Mod/Robot/Gui/PreCompiled.h b/src/Mod/Robot/Gui/PreCompiled.h index eb2a0614..e5496201 100644 --- a/src/Mod/Robot/Gui/PreCompiled.h +++ b/src/Mod/Robot/Gui/PreCompiled.h @@ -38,8 +38,6 @@ # define RobotGuiExport #endif -#include - #ifdef _MSC_VER # pragma warning(disable : 4005) # pragma warning(disable : 4273) diff --git a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp index dbfd423b..ceae48c4 100644 --- a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -#include /// Qt Include Files #include #include